/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.railway.app;

import java.awt.CardLayout;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author Kenny
 */
public class StaffForm extends javax.swing.JPanel {

    private CardLayout cl;

    /**
     * Creates new form ScheduleForm
     */
    public StaffForm() {
        initComponents();
        cl = (CardLayout) jpTaskContent.getLayout();
        jpTaskContent.add(new JPanel(), "null");
        jpTaskContent.add(new NewStaffPanel(), "new");
        jpTaskContent.add(new ModifyStaffPanel(), "modify");
        jpTaskContent.add(new DeleteStaffPanel(), "delete");
        jpTaskContent.add(new StaffStatusPanel(), "status");
        jpTaskContent.add(new StaffDetailPanel(), "detail");
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    public static void main(String args[]) {
        JFrame frame = new JFrame();
        frame.add(new StaffForm());
        frame.setVisible(true);
        frame.pack();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jbtNew = new javax.swing.JButton();
        jbtModify = new javax.swing.JButton();
        jbtDelete = new javax.swing.JButton();
        jbtStatus = new javax.swing.JButton();
        jbtDetail = new javax.swing.JButton();
        jpTaskContent = new javax.swing.JPanel();

        setBackground(new java.awt.Color(236, 240, 241));
        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Admin and staff maintenance", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Emoji", 0, 12))); // NOI18N
        setPreferredSize(new java.awt.Dimension(890, 539));
        setLayout(null);

        jbtNew.setBackground(new java.awt.Color(52, 152, 219));
        jbtNew.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtNew.setForeground(new java.awt.Color(255, 255, 255));
        jbtNew.setText("New");
        jbtNew.setFocusPainted(false);
        jbtNew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtNewActionPerformed(evt);
            }
        });
        add(jbtNew);
        jbtNew.setBounds(10, 20, 150, 50);

        jbtModify.setBackground(new java.awt.Color(52, 152, 219));
        jbtModify.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtModify.setForeground(new java.awt.Color(255, 255, 255));
        jbtModify.setText("Modify");
        jbtModify.setFocusPainted(false);
        jbtModify.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtModifyActionPerformed(evt);
            }
        });
        add(jbtModify);
        jbtModify.setBounds(190, 20, 150, 50);

        jbtDelete.setBackground(new java.awt.Color(52, 152, 219));
        jbtDelete.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtDelete.setForeground(new java.awt.Color(255, 255, 255));
        jbtDelete.setText("Delete");
        jbtDelete.setFocusPainted(false);
        jbtDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtDeleteActionPerformed(evt);
            }
        });
        add(jbtDelete);
        jbtDelete.setBounds(370, 20, 150, 50);

        jbtStatus.setBackground(new java.awt.Color(52, 152, 219));
        jbtStatus.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtStatus.setForeground(new java.awt.Color(255, 255, 255));
        jbtStatus.setText("Status");
        jbtStatus.setFocusPainted(false);
        jbtStatus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtStatusActionPerformed(evt);
            }
        });
        add(jbtStatus);
        jbtStatus.setBounds(550, 20, 150, 50);

        jbtDetail.setBackground(new java.awt.Color(52, 152, 219));
        jbtDetail.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtDetail.setForeground(new java.awt.Color(255, 255, 255));
        jbtDetail.setText("Details");
        jbtDetail.setFocusPainted(false);
        jbtDetail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtDetailActionPerformed(evt);
            }
        });
        add(jbtDetail);
        jbtDetail.setBounds(730, 20, 150, 50);

        jpTaskContent.setLayout(new java.awt.CardLayout());
        add(jpTaskContent);
        jpTaskContent.setBounds(10, 70, 870, 460);

        getAccessibleContext().setAccessibleName("Admin and staff maintenance\n");
    }// </editor-fold>//GEN-END:initComponents

    private void jbtNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtNewActionPerformed
        jbtNew.setBackground(new Color(41, 128, 185));
        jbtModify.setBackground(new Color(52, 152, 219));
        jbtDelete.setBackground(new Color(52, 152, 219));
        jbtStatus.setBackground(new Color(52, 152, 219));
        jbtDetail.setBackground(new Color(52, 152, 219));
        cl.show(jpTaskContent, "new");
    }//GEN-LAST:event_jbtNewActionPerformed

    private void jbtModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtModifyActionPerformed
        jbtNew.setBackground(new Color(52, 152, 219));
        jbtModify.setBackground(new Color(41, 128, 185));
        jbtDelete.setBackground(new Color(52, 152, 219));
        jbtStatus.setBackground(new Color(52, 152, 219));
        jbtDetail.setBackground(new Color(52, 152, 219));
        cl.show(jpTaskContent, "modify");
    }//GEN-LAST:event_jbtModifyActionPerformed

    private void jbtDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtDeleteActionPerformed
        jbtNew.setBackground(new Color(52, 152, 219));
        jbtModify.setBackground(new Color(52, 152, 219));
        jbtDelete.setBackground(new Color(41, 128, 185));
        jbtStatus.setBackground(new Color(52, 152, 219));
        jbtDetail.setBackground(new Color(52, 152, 219));
        cl.show(jpTaskContent, "delete");
    }//GEN-LAST:event_jbtDeleteActionPerformed

    private void jbtStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtStatusActionPerformed
        jbtNew.setBackground(new Color(52, 152, 219));
        jbtModify.setBackground(new Color(52, 152, 219));
        jbtDelete.setBackground(new Color(52, 152, 219));
        jbtStatus.setBackground(new Color(41, 128, 185));
        jbtDetail.setBackground(new Color(52, 152, 219));
        cl.show(jpTaskContent, "status");
    }//GEN-LAST:event_jbtStatusActionPerformed

    private void jbtDetailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtDetailActionPerformed
        jbtNew.setBackground(new Color(52, 152, 219));
        jbtModify.setBackground(new Color(52, 152, 219));
        jbtDelete.setBackground(new Color(52, 152, 219));
        jbtStatus.setBackground(new Color(52, 152, 219));
        jbtDetail.setBackground(new Color(41, 128, 185));
        cl.show(jpTaskContent, "detail");
    }//GEN-LAST:event_jbtDetailActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbtDelete;
    private javax.swing.JButton jbtDetail;
    private javax.swing.JButton jbtModify;
    private javax.swing.JButton jbtNew;
    private javax.swing.JButton jbtStatus;
    private javax.swing.JPanel jpTaskContent;
    // End of variables declaration//GEN-END:variables
}
